package com.lemt.sunmao.service;

import com.lemt.sunmao.domain.User;
import com.lemt.sunmao.response.ResponstData;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

// 项目springcloud-consumer-dept-feign才会需要这个，只是改变调用方式
@Component
@FeignClient(value = "LEMT-PROVIDER-SUNMAO")
public interface UserClientService {
    @GetMapping("/user/findPageUsers")
    public ResponstData findPageUsers(String username, Integer currentPage, Integer pageSize);

    @GetMapping("/user/{id}")
    public ResponstData getById(@PathVariable("id") Long id);

    @DeleteMapping("/user/{id}")
    public ResponstData deleteById(@PathVariable("id") Long id);

    @PostMapping
    public ResponstData save(@RequestBody User user);
}
